import { Body, Controller, Post } from '@nestjs/common';
import { RoomService } from './room.service';
import { CreateRoomDto } from './dto/room.dto';
import { FormDataRequest } from 'nestjs-form-data';

@Controller('room')
export class RoomController {
  constructor(private roomService: RoomService) {}
  @Post('create_room')
  @FormDataRequest()
  async creatRoom(@Body() data: CreateRoomDto) {
    try {
      await this.roomService.createRoom(data);
      return '创建成功';
    } catch (error) {
      throw error;
    }
  }
}
